Skip to content

fix: handle empty segments in formatForGoTypeName#1057

Merged
avallete merged 1 commit intosupabase:masterfrom
oniani1:fix/go-type-name-crash-on-underscore
Apr 8, 2026
Merged

fix: handle empty segments in formatForGoTypeName#1057
avallete merged 1 commit intosupabase:masterfrom
oniani1:fix/go-type-name-crash-on-underscore

Conversation

@oniani1
Copy link
Copy Markdown
Contributor

@oniani1 oniani1 commented Apr 5, 2026

Fixes #1056

formatForGoTypeName crashes with a TypeError on names starting with non-alphanumeric characters (like _prisma_migrations). The split produces an empty string element, and indexing into it gives undefined.

Added the same if (word) guard that formatForPyClassName in python.ts already uses.

@oniani1 oniani1 requested review from a team, avallete and soedirgo as code owners April 5, 2026 21:01
@avallete
Copy link
Copy Markdown
Member

avallete commented Apr 8, 2026

Thank's for your contribution !

@avallete avallete merged commit cd825bc into supabase:master Apr 8, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Go type generator crashes on names starting with underscore

2 participants